package com.mycompany.app.hr.eleave.service.impl;

import java.util.List;

import org.hibernate.SessionFactory;

import com.mycompany.app.hr.common.pagination.Page;
import com.mycompany.app.hr.common.utility.dao.hibernate.SimpleHibernateTemplate;
import com.mycompany.app.hr.eleave.model.LeaveType;
import com.mycompany.app.hr.eleave.service.ILeaveTypeService;

public class LeaveTypeServiceImpl implements ILeaveTypeService {

    private SimpleHibernateTemplate<LeaveType, Long> leaveTypeDao;

    public void setSessionFactory(SessionFactory sessionFactory) {

        leaveTypeDao = new SimpleHibernateTemplate<LeaveType, Long>(
                sessionFactory, LeaveType.class);

    }

    public List<LeaveType> getAllLeaveTypes(Page<LeaveType> page) {

        return leaveTypeDao.findAll(page).getResult();

    }

}
